package org.zfes.snowier.cloud.zbss.tts.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

@Configuration
public class TssConfig implements InitializingBean, DisposableBean{
	private static  final Logger log= LoggerFactory.getLogger(TssConfig.class);
	
	
    @Autowired
    private Environment env;
    
    
    private String audioUploadPath;
    
    private String audioSavePath;
    
    private String appid;
    
    private String iatApiKey;
    private String ttsApiKey;
    
    
	@Override
	public  void afterPropertiesSet() {
		  
		audioUploadPath =  env.getProperty("tts.audioUploadPath");
		audioSavePath =  env.getProperty("tts.audioSavePath");
		 
		iatApiKey =  env.getProperty("tts.iat.apikey");
		ttsApiKey =  env.getProperty("tts.tts.apikey");
		appid =  env.getProperty("tts.appid");
		
		log.debug("FileConfig:|| "+toString());
	 }

	@Override
	public  void destroy() throws Exception {
		
	}

	public String getAudioUploadPath() {
		return audioUploadPath;
	}

	public TssConfig setAudioUploadPath(String audioUploadPath) {
		this.audioUploadPath = audioUploadPath;
		return this;
	}

	public String getAudioSavePath() {
		return audioSavePath;
	}

	public TssConfig setAudioSavePath(String audioSavePath) {
		this.audioSavePath = audioSavePath;
		return this;
	}

	public String getIatApiKey() {
		return iatApiKey;
	}

	public TssConfig setIatApiKey(String iatApiKey) {
		this.iatApiKey = iatApiKey;
		return this;
	}

	public String getTtsApiKey() {
		return ttsApiKey;
	}

	public TssConfig setTtsApiKey(String ttsApiKey) {
		this.ttsApiKey = ttsApiKey;
		return this;
	}


	public String getAppid() {
		return appid;
	}

	public TssConfig setAppid(String appid) {
		this.appid = appid;
		return this;
	}




	
}
